<!doctype html>
<title>Using pop</title>

<script>

//Create an empty array
var closet = ["hat", "umbrella", "katana"];

//Pop the last element
var lastElement = closet.pop();

//View the value of lastElement
console.log("The popped element: " + lastElement);

//View the new closet array
console.log("The closet array: " + closet);

</script>